using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Terra.Data.Entities;

namespace Terra.Data.Entities.Identity;

/// <summary>
/// 角色实体
/// </summary>
[Table("Roles")]
[Comment("角色表")]
public class Role : AuditEntityBase<Guid>
{
    /// <summary>
    /// 角色名称
    /// </summary>
    [Required]
    [StringLength(50)]
    [Comment("角色名称")]
    public string Name { get; set; }

    /// <summary>
    /// 规范化角色名称
    /// </summary>
    [Required]
    [StringLength(50)]
    [Comment("规范化角色名称")]
    public string NormalizedName { get; set; }

    /// <summary>
    /// 并发标记
    /// </summary>
    [StringLength(36)]
    [Comment("并发标记")]
    public string ConcurrencyStamp { get; set; }

    /// <summary>
    /// 描述
    /// </summary>
    [StringLength(200)]
    [Comment("角色描述")]
    public string Description { get; set; }

    /// <summary>
    /// 是否为系统角色
    /// </summary>
    [Comment("是否为系统角色")]
    public bool IsSystem { get; set; }

    /// <summary>
    /// 用户角色关系
    /// </summary>
    [InverseProperty("Role")]
    public virtual ICollection<UserRole> UserRoles { get; set; }
}